<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <h1>for-of循环</h1>
    <script>
        var arr = ['hello', 'world', 3, 4, 5]
        // 主要用于实现数组的循环
        for (let item of arr) {
            console.log(item);
        }
        

        // for-in可以实现对象的循环
        var obj={
            name:"jack",age:20
        }
        // key 获取到的时候对象属性名
        for (let key in obj) {
            console.log(key,obj[key]);
        }

    </script>
</body>

</html>